<?php

//date_default_timezone_set('Asia/Shanghai');
//ini_set('display_errors', 'on');
//error_reporting(E_ALL);

use Workerman\Worker;
use \Workerman\WebServer;

if(strpos(strtolower(PHP_OS), 'win') === 0)
{
    exit("start.php not support windows, please use start_for_win.bat\n");
}

// 检查扩展
if(!extension_loaded('pcntl'))
{
    exit("Please install pcntl extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
}

if(!extension_loaded('posix'))
{
    exit("Please install posix extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
}

// 标记是全局启动
define('GLOBAL_START', 1);

require_once __DIR__ . '/vendor/autoload.php';

// WebServer
$web = new WebServer("http://0.0.0.0:8383");
// WebServer数量
$web->count = 4;
// 设置站点根目录
$web->addRoot('www.adput.com', __DIR__.'/application');
// 运行所有服务
Worker::runAll();
